Repository navigation
docs(inversion): two-stage curvature kernel docstring — dispatch is on pix_pixels; two-stage wins on Delaunay too (autolens_profiling#274) - #557
Merged
Conversation
…ispatch is on pix_pixels, and two-stage wins on Delaunay too (autolens_profiling#274) The docstring named a CURVATURE_TWO_STAGE_COST_RATIO_THRESHOLD that does not exist (the dispatcher branches on pix_pixels <= CURVATURE_TWO_STAGE_MAX_PIX_PIXELS) and predicted the two-stage form loses for narrow barycentric Delaunay mappings. Lever 4a measured that prediction on the HST Delaunay N=1500 fixed-light cell (RAL job 343394, u0 = 1.604, one thread, 64 repeats, ABBA PASS): two-stage beats the direct loop 85.0 vs 102.1 ms at the site and by 6.4 % on the whole call, and a touched-index variant is slower too. No code change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Collaborator
Author
|
Measured in autolens_profiling#274 / PR PyAutoLabs/autolens_profiling#275 (note results/notes/fixed_lens_light_s4_2026_09.md). |
This was referenced Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Docstring-only fix from autolens_profiling#274 (fixed-lens-light numba CPU, phase 4 wave A). The two-stage curvature kernel's docstring said the dispatcher
curvature_matrix_via_sparse_operator_from"chooses between the two from the measured geometry -- seeCURVATURE_TWO_STAGE_COST_RATIO_THRESHOLD". No such constant exists; the dispatcher branches onpix_pixels <= CURVATURE_TWO_STAGE_MAX_PIX_PIXELS(4096). The same paragraph predicted that two-stage "loses when the source space is large and the mappings narrow (barycentric Delaunay, u0 ~ 1.55)". That prediction was never measured on the Delaunay fixed-light cell; lever 4a measured it (RAL job 343394, HST Delaunay N=1500, u0 = 1.604, one thread, 64 repeats, ABBA gate PASS on every row) and it is refuted there: two-stage beats the direct loop 85.0 vs 102.1 ms at the site and by 6.4 % on the whole likelihood call, and a touched-index two-stage variant is slower too (97.0 ms). The docstring now names the real dispatch rule and records the measurement in place of the refuted prediction. No code change; the pixel-count cap stands.API Changes
None — internal changes only (one docstring).
Test Plan
pytest test_autoarray/inversion/inversion/imaging/test_inversion_imaging_util.py -q(docstring-only change; the two-stage reference / dense-operator / dispatch tests at :829 / :887 / :947 unchanged)grep -rn CURVATURE_TWO_STAGE_COST_RATIO_THRESHOLD autoarray/returns nothingFull API Changes (for automation & release notes)
Changed Behaviour
autoarray.inversion.inversion.imaging_numba.inversion_imaging_numba_util.curvature_matrix_via_sparse_operator_two_stage_fromcorrected (dispatch rule + the lever 4a measurement).Measured in autolens_profiling#274 (note
results/notes/fixed_lens_light_s4_2026_09.md, profiling PR linked from the issue).🤖 Generated with Claude Code